#ifndef	SUDOKU_GROUP_H
#define	SUDOKU_GROUP_H

#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <boost/foreach.hpp>

#include "sudoku_field.h"

using namespace std;

class Group;
class GroupAdd;
class GroupUnique;
//------------------------------------------------------------------------------------------------------------
class Group
{
protected:
    vector<int> fieldsIndices;
//    std::vector<int>* possibleIndices;
    int emptyValue;
public:
    Group(int pemptyValue = 0): emptyValue(pemptyValue) {}
    virtual void updateAvailableSet(set<int,ValuesCmp<vector<int>* > >* availableSet, map<int,SudokuField*>* psudokuBoard, int emptyValue) = 0;
    vector<int>* getIndicesVector() {return &fieldsIndices;};
    void print();
};
//------------------------------------------------------------------------------------------------------------
class GroupAdd : public Group
{
	int expectedSum;
public:
    GroupAdd(int pexpectedSum, int pemptyValue = 0): Group(pemptyValue), expectedSum(pexpectedSum) {}
    virtual void updateAvailableSet(set<int,ValuesCmp<vector<int>* > >* availableSet, map<int,SudokuField*>* psudokuBoard, int emptyValue);
};
//------------------------------------------------------------------------------------------------------------
class GroupUnique : public Group
{
public:
    GroupUnique(int pemptyValue): Group(pemptyValue) {}
    virtual void updateAvailableSet(set<int,ValuesCmp<vector<int>* > >* availableSet, map<int,SudokuField*>* psudokuBoard, int emptyValue);
};
//------------------------------------------------------------------------------------------------------------
#endif //SUDOKU_GROUP_H
